<?php
//use Illuminate\Support\Facades\Schema;
use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopCartsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_carts', function (Blueprint $table) {
            $table->comment = '购物车表';
            $table->increments('id')->comment('购物ID');
			$table->integer('product_id')->comment('商品id');
			$table->integer('user_id')->comment('用户id');
			$table->tinyInteger('num')->comment('购买数量');
			$table->integer('specs_id')->comment('商品规格id');
			$table->string('specs')->default('')->comment('已选规格');
			$table->decimal('money',8,2)->default('0.00')->comment('加入购物车时商品的价格');
            $table->timestamps(); 
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_carts');
    }
}
